package com.wtzz.police.base.controller;

import com.wtzz.police.base.model.enums.Role;
import com.wtzz.police.base.model.response.ResponseBean;
import com.wtzz.police.base.model.annotaions.RoleCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 角色权限Controller
 */
@Api(tags = "权限")
@RestController
@RequestMapping("role")
public class RoleController {

    @ApiOperation(value = "获取所有权限列表(管理员权限)")
    @RoleCheck(Role.ADMIN)
    @GetMapping("list")
    public ResponseBean<Role[]> list() {
        return ResponseBean.of(Role.values());
    }
}
